home *** CD-ROM | disk | FTP | other *** search
- /*
- File: OpenTptPCISupport.h
-
- Contains: File to include everything you need to declare a module
-
- Copyright: © 1993-1996 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <FW3> 6/27/96 ES Took out lines that should have been deleted for release disk.
- <3> 9/15/95 mjq Make sure release disk includes Devices.h, not NewDevices.h
- <2> 9/05/95 mjq • Rename OpenTptDev.h to OpenTptCommon.h
- <1> 7/31/95 mjq • Started over from OpenTransport project
-
- To Do:
-
- */
-
- #ifndef __OPENTPTPCISUPPORT__
- #define __OPENTPTPCISUPPORT__
-
- #ifndef __OPENTPTCOMMON__
- #include <OpenTptCommon.h>
- #endif
- #ifndef __DEVICES__
- //zzz#include <NewDevices.h> /* this line deleted for release disk */
- //zzz#if 0 /* this line deleted for release disk */
- #include <Devices.h>
- //zzz#endif /* this line deleted for release disk */
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=mac68k
- #endif
-
- /*******************************************************************************
- ** This is the cookie that is passed to your STREAM Module
- ********************************************************************************/
-
- struct OTPCIInfo
- {
- RegEntryID fTheID;
- void* fConfigurationInfo;
- size_t fConfigurationLength;
- };
-
- typedef struct OTPCIInfo OTPCIInfo;
-
- /*******************************************************************************
- ** PCI Card support
- ********************************************************************************/
- /*
- * All PCI card modules should have the following bits set in their
- * install_info structure:
- * kOTModIsDriver.
- *
- * They should NEVER have the kOTModPushAlways or the kOTModIsModule
- * flags set.
- *
- * The kOTModIsLowerMux bits should be set if the driver is a lower
- * multiplexor, although Open Transport does nothing with the information
- * today.
- *
- * The kOTModUpperIsDLPI bit should be set if the driver uses the DLPI message
- * specification. The kOTModUpperIsTPI bit should be set if the driver uses
- * the TPI message specification.
- */
-
- /* -------------------------------------------------------------------------
- Macro to put together the driverServices.service[x].serviceType field
-
- // xxxxxddd dddddddd ffffffff xxxxxxTD
- //
- // where "d" is the device type for Open Transport,
- // the lower two bits are whether the driver is TPI or DLPI,
- // and the "f" bits are the framing option flags.
- // and all other bits should be 0
- ------------------------------------------------------------------------- */
-
- #define OTPCIServiceType(devType, framingFlags, isTPI, isDLPI) \
- ((devType << 16) | (((framingFlags) & 0xff) << 8) | (isTPI ? 2 : 0) | (isDLPI ? 1 : 0 ))
-
- /* -------------------------------------------------------------------------
- Typedef for the ValidateHardware function. This function will be
- called only once, at system boot time, before installing your driver
- into the Open Transport module registry.
- The param pointer will is a RegEntryIDPtr - don't be changing the
- values there!
- ------------------------------------------------------------------------- */
-
- typedef OTResult (* _CDECL ValidateHardwareProcPtr)(OTPCIInfo* param);
-
- enum
- {
- kOTPCINoErrorStayLoaded = 1
- };
-
- /* -------------------------------------------------------------------------
- Some descriptors we use - these should eventually show up
- in system header files somewhere.
- ------------------------------------------------------------------------- */
-
- #define kDescriptorProperty "driver-descriptor"
- #define kDriverProperty "driver,AAPL,MacOS,PowerPC"
- #define kDriverPtrProperty "driver-ptr"
- #define kSlotProperty "AAPL,slot-name"
-
- /* -------------------------------------------------------------------------
- Maximum # of services support by Open Transport. If your module
- exports more than this # of services, Open Transport will not be
- able to use the module.
- ------------------------------------------------------------------------- */
-
- enum
- {
- kMaxServices = 20
- };
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=reset
- #endif
-
- #endif /* __OPENTPTPCISUPPORT__ */
-